<template>
<div>
  <div v-show="certificateListVisible" class="mod-configs">
    <div class="div-s" ref="divs">
    <el-form :model="params" :label-position="labelPosition" :inline="true" label-width="70px" class="queryFormed">
        <el-row class="row-s">
          <el-col :span="6">
           <el-form-item label="录入类型">
            <el-select v-model="params.certificateType">
              <el-option
                v-for="item in certificateTypes"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          </el-col>
          <el-col class="col-center" :span="6">
          <el-form-item label="状态">
            <el-select v-model="params.status">
              <el-option
                v-for="item in statuses"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          </el-col>
          <el-col class="col-center" :span="6">
          <el-form-item label="姓名">
            <el-input v-model="params.name" clearable placeholder="请填写姓名"></el-input>
          </el-form-item>
      </el-col>
      <el-col class="col-right" v-if="conceal" :span="6">
      <el-form-item label="身份证号">
            <el-input v-model="params.idCard" clearable placeholder="请填写身份证号"></el-input>
      </el-form-item>
      </el-col>
      <el-col v-if="conceal" :span="6">
      <el-form-item label="手机号">
            <el-input v-model="params.mobile" clearable placeholder="请填写手机号"></el-input>
      </el-form-item>
      </el-col>
      <el-col class="col-center" v-if="conceal" :span="6">
      <el-form-item label="学历">
            <el-select v-model="params.academic" placeholder="请选择学历">
                <el-option
                  v-for="item in academics"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
      </el-form-item>
      </el-col>
      <el-col class="col-center" v-if="conceal" :span="6">
      <el-form-item label="证书类型">
            <el-select v-model="params.pidTypes" filterable placeholder="请选择证书类型" @change="jobChange">
              <el-option
                v-for="item in editableTabss"
                :key="item.id"
                :label="item.name"
                :value="item.code">
              </el-option>
            </el-select>
      </el-form-item>
      </el-col>
      <el-col class="col-right" v-if="conceal" :span="6">
      <el-form-item label="证书类别">
            <el-select v-model="params.idType" filterable placeholder="请选择证书类别" @change="confChange">
              <el-option
                v-for="item in confInfos"
                :key="item.id"
                :label="item.name"
                :value="item.value">
              </el-option>
            </el-select>
      </el-form-item>
      </el-col>
      <el-col v-if="conceal" :span="6">
      <el-form-item label="证书专业">
            <el-select v-model="params.profession" placeholder="请选择证书专业">
                <el-option
                  v-for="item in professions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
            </el-select>
      </el-form-item>
      </el-col>
      <el-col class="col-center" v-if="concealName" :span="6">
      <el-form-item label="保管部门">
            <el-tree-select
              style="width:100%"
              :data="treeData"
              v-model="params.keepDeptId"
              node-key="id"
              placeholder="请选择保管部门"
            />
      </el-form-item>
      </el-col>
      <el-col class="col-center" v-if="conceal" :span="6">
          <el-form-item label="证书编号">
            <el-input v-model="params.certificateNo" clearable placeholder="请填写证书编号"></el-input>
          </el-form-item>
      </el-col>
      <el-col :class='{"col-right":userCol ==1,"col-center":userCol ==2}' v-if="conceal" :span="6">
      <el-form-item class="fazheng" label="发证日期">
          <el-date-picker type="date" v-model="params.releaseTime" :picker-options="pickerOptionsValidityEndTimeA" placeholder="请选择发证日期" style="width:100%"></el-date-picker>
      </el-form-item>
      </el-col>
      <el-col :class='{"col-essss":userCol ==1,"col-right":userCol ==2}' v-if="conceal" :span="6">
      <el-form-item class="fazheng" label="到期日期">
            <el-date-picker type="date" v-model="params.validityEndTime" placeholder="请选择到期日期" @blur="blurValidityEndTime" :picker-options="pickerOptionsValidityEndTime" style="width:100%"></el-date-picker>
      </el-form-item>
      </el-col>
      <el-col class="col-center" v-if="conceal" :span="6">
          <el-form-item label="是否注册">
            <el-select v-model="params.registerType" placeholder="请选择证书是否注册" style="width:100%">
                <el-option
                  v-for="item in registerTypes"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
            </el-select>
          </el-form-item>
      </el-col>
      <!-- <el-button class="buttonItem" type="primary" @click="clickDataFormSubmit()">搜 索</el-button> -->
      <!-- <el-button class="buttonItem" size="small" type="primary" icon="el-icon-refresh-right picturess" @click="queryAll()">重置</el-button> -->
      <!-- <el-button class="buttonItem" size="small" type="primary" icon="iconfont iconsoushuo" @click="queryHandle()">  高级搜索</el-button> -->
      <!-- <el-form-item class="itemButton"> -->
        <!-- <el-button class="buttonItem" size="small" type="danger" icon="iconfont iconlajixiang" v-if="isAuth('certificate:certificateInfo:delete')" @click="certificateinfoCrashHandler()">已作废</el-button> -->
        <!-- <el-button class="buttonItem" size="small" icon="el-icon-picture picturess" @click="noCertificate">无证书图片</el-button> -->
        <!-- <div id="login_container"></div> -->
      <!-- </el-form-item> -->
        <el-col v-if="concealNameCol" :span="6">
        <el-form-item>
      </el-form-item>
        </el-col>
          <el-col v-if="conceal" class="col-center" :span="6">
          <el-form-item label="项目名称">
            <el-input v-model="params.projectName" clearable placeholder="请填写项目名称"></el-input>
          </el-form-item>
      </el-col>
      <el-col class="col-right" :span="6">
      <el-form-item class="item-all">
      <el-button v-if="isAuth('certificate:certificateInfo:info') && !hangAlsoDiog && !hangshouhui" class="buttonItem" size="mini" plain @click="queryAll()">重 置</el-button>
      <el-button v-if="isAuth('certificate:certificateInfo:info')" class="buttonItem" size="mini" type="primary" @click="clickDataFormSubmit()">搜 索</el-button>
      <el-button style="color:#6E92E9;" v-if="unfold" @click="clicKunfold()" type="text">展开<i class="el-icon-arrow-down zhankai"></i></el-button>
      <el-button style="color:#6E92E9;" v-if="!unfold" @click="clickPackUp()" type="text">收起<i class="el-icon-arrow-up zhankai"></i></el-button>
      </el-form-item>
      </el-col>
      </el-row>
    </el-form>
    </div>
    <!-- 表格开始 -->
    <div class="div-e">
      <div class="div-inquire">
        <div class="in-t">
          <div class="in-ts"></div>
          <h3>证书查询</h3>
        </div>
        <div class="div-button">
          <el-button class="div-buttonItema" plain v-if="zuofeiliebiao" size="mini" icon="iconfont iconlajixiang" @click="certificateinfoCrashHandler()">作废列表</el-button>
          <el-button v-if="isAuth('certificate:certificateInfo:list')" class="div-buttonItemc" size="mini" type="primary" plain icon="el-icon-upload2" @click="exportXls()">证书导出</el-button>
        <el-button v-if="indexPia" class="div-buttonItemc" size="mini" type="primary" plain icon="el-icon-edit-outline" @click="clickHangShou()">批量还回</el-button>
        <el-button  v-if="indexPi" class="div-buttonItemc" size="mini" type="primary" plain icon="el-icon-edit-outline" @click="clickHangAlso()">批量挂还</el-button>
        </div>
      </div>
    <el-tabs class="tabs-s" v-model="activeName" @tab-click="handleClick">
      <el-tab-pane :label="item.name" :name="item.code" v-for="item in editableTabs" :key="item.code">
        <!-- 组件 -->
        <certificate-type ref="child" @falseClickClick="falseClickClick" @onChange="onChange" @clickCertificateListVisible="clickCertificateListVisible" :selectionTrue="selectionTrue" :flag="flag" :params="params"></certificate-type>
      </el-tab-pane>
      </el-tabs>
    <!-- <query-model v-if="queryModelVisible" ref="queryModel" @refreshDataList="setParams"></query-model> -->

  </div>

</div>
      <div class="div-hangAlso" v-if="hangAlsoDiog">
      <div class="div-hangS"><span class="yixuanze">已选择</span><span class="shuju">{{this.selectionIdDl}}</span><span class="xiang">项</span><span>操作前请确认数据是否有误</span></div>
      <div class="div-hangE">
        <el-button class="div-buttonItemc" size="mini" type="primary" plain @click="trueClick()">批量挂还</el-button>
        <el-button class="div-buttonItema" plain  size="mini" @click="falseClick()">取消挂还</el-button>
      </div>
    </div>

      <div class="div-hangAlso" v-if="hangshouhui">
      <div class="div-hangS"><span class="yixuanze">已选择</span><span class="shuju">{{this.selectionIdDl}}</span><span class="xiang">项</span><span>操作前请确认数据是否有误</span></div>
      <div class="div-hangE">
        <el-button class="div-buttonItemc" size="mini" type="primary" plain @click="trueClickeA()">批量还回</el-button>
        <el-button class="div-buttonItema" plain  size="mini" @click="falseClickeA()">取消还回</el-button>
      </div>
    </div>

  <certificate-detail v-if="certificateListVisibleDetail" :isEdited="isEdited" :flag="flag" :visId="visId"></certificate-detail>
  <certificateinfo-crash v-if="certificateinfoCrashVisible" ref="certificateinfoCrash"></certificateinfo-crash>
</div>
</template>

<script>
  import merge from 'lodash/merge'
  import ElTreeSelect from '@/components/treeSelect/index.vue'
  import CertificateType from './certinfo/certificate-type'
  import CertificateinfoCrash from './certinfo/certificateinfolist-crash'
  import EditableCell from '@/components/edit-table-cell/EditableCell'
  import CertificateDetail from './certinfo/certificate-list-detail'
  import { eventBus } from '../../../../eventBus'

  import Vue from 'vue'
  export default {
    data () {
      return {
        eddop: true,
        labelPosition: 'right',
        conceal: false,
        indexPi: true,
        indexPia: true,
        selectionTrue: false,
        zuofeiliebiao: true,
        selectionIdDl: 0,
        hangAlsoDiog: false,
        hangshouhui: false,
        concealName: false,
        concealNameCol: false,
        unfold: true,
        queryModelVisible: false,
        editModeEnabled: true,
        dialogVisible: false,
        multiple: false,
        kiveList: false,
        isEdited: true,
        certificateListVisible: true,
        certificateinfoCrashVisible: false,
        certificateListVisibleDetail: false,
        dialogConformVisible: false,
        flag: false,
        userCol: 1,
        userName: '',
        pickerOptionsValidityEndTime: {
          disabledDate: (time) => {
            return time.getTime() < this.params.releaseTime
          }
        },

        pickerOptionsValidityEndTimeA: {},
        statuses: [
          {label: '全部', value: ''},
          {label: '空闲', value: 0},
          {label: '挂出', value: 1},
          {label: '挂入', value: 3},
          {label: '挂还', value: 2},
          {label: '投标', value: 21},
          {label: '项目', value: 22},
          {label: '中标', value: 23},
          {label: '其他', value: 24}
        ],
        certificateTypes: [
          {
            value: '',
            label: '全部'
          }, {
            value: 1,
            label: '在职员工'
          }, {
            value: 2,
            label: '挂靠'
          },
          {
            value: 3,
            label: '非在职员工'
          }
        ],
        academics: [
          {
            value: '',
            label: '全部'
          },
          {
            value: '博士',
            label: '博士'
          }, {
            value: '硕士',
            label: '硕士'
          }, {
            value: '本科',
            label: '本科'
          }, {
            value: '专科',
            label: '专科'
          }, {
            value: '高职高专',
            label: '高职高专'
          }, {
            value: '中专',
            label: '中专'
          }, {
            value: '高中',
            label: '高中'
          }, {
            value: '初中',
            label: '初中'
          }, {
            value: '小学',
            label: '小学'
          }, {
            value: '其他',
            label: '其他'
          }],
        registerTypes: [{
          value: 0,
          label: '否'
        }, {
          value: 1,
          label: '是'
        }, {
          value: 2,
          label: '非注册类证书'
        }],
        candidatesSources: [{
          value: 1,
          label: '个人'
        }, {
          value: 2,
          label: '企业'
        }],
        uploadTypes: [{
          value: 0,
          label: '否'
        }, {
          value: 1,
          label: '是'
        }],
        activeName: 'threejob',
        chartData: {
          columns: ['type', 'num'],
          rows: []
        },
        waterfallData: {
          columns: ['type', 'num'],
          rows: []
        },
        chartExtend: {
          color: ['#07AB6E', '#E83E25', '#1B92FB', '#FC8E2D']
        },
        histogramExtend: {
          color: ['#E83E25', '#07AB6E']
        },
        loading: true,
        dataEmpty: true,
        editableTabs: [],
        editableTabss: [],
        treeData: [],
        visId: {},
        index: 0,
        registerTypes: [{
          value: 0,
          label: '否'
        }, {
          value: 1,
          label: '是'
        }, {
          value: 2,
          label: '非注册类证书'
        }],
        // heightis:295,
        a: '',
        params: {
          name: '',
          certificateType: '',
          status: '',
          idCard: '',
          mobile: '',
          academic: '',
          pidTypes: '',
          idType: '',
          profession: '',
          certificateNo: '',
          keepDeptId: '',
          releaseTime: '',
          validityEndTime: '',
          registerType: '',
          projectName: '',
          warrantFlag: ''
        },
        limitNum: 1,  // 上传excell时，同时允许上传的最大数
        fileList: [],   // excel文件列表
        dxList: [],
        jobs: [],
        shuzukey: ['81', '83'],
        jobName: '',
        confInfos: [],
        professions: [],
        currentRow: {},
        canUpdate: true
        // appid:'',
        // redirect_uri:''
      }
    },
    components: {
      CertificateType,
      CertificateinfoCrash,
      EditableCell,
      CertificateDetail,
      ElTreeSelect
    },
    mounted () {
      this.initJobs()
      this.getRingCollect()
      this.getCertDetailCollect()
      eventBus.$on('certificateinfolist', (msg) => {
        this.kiveList = msg
        this.clickKive()
      })
      // console.log(this.$route.params.skipPathA);

      if (this.$route.params.skipPathA === 1) {
        this.clickPathA()
      }
      if (this.$route.params.skipPathB === 2) {
        this.clickPathB()
      }
      if (this.$route.params.skipPathC === 3) {
        this.clickPathC()
      }
      if (this.$route.params.skipPathD === 4) {
        this.clickPathD()
      }
      if (this.$route.params.skipPathE === 5) {
        this.clickPathE()
      }
      if (this.$route.params.skipPathF === 6) {
        this.clickPathF()
      }
      if (this.$route.params.skipParamA === 1) {
        this.clickPathO()
      }
      if (this.$route.params.skipParamB === 2) {
        this.clickPathP()
      }
      if (this.$route.params.skipParamC === 3) {
        this.clickPathQ()
      }
      if (this.$route.params.skipPathL === 7) {
        this.clickPathL()
      }
      if (this.$route.params.skipPathM === 8) {
        this.clickPathM()
      }
    },
    watch: {
      $route: {
      // immediate:true,
        handler: function (val, oldVal) {
          if (val.params.skipPathA === 1) {
            this.clickPathA()
          }
          if (val.params.skipPathB === 2) {
            this.clickPathB()
          }
          if (val.params.skipPathC === 3) {
            this.clickPathC()
          }
          if (val.params.skipPathD === 4) {
            this.clickPathD()
          }
          if (val.params.skipPathE === 5) {
            this.clickPathE()
          }
          if (val.params.skipPathF === 6) {
            this.clickPathF()
          }
          if (val.params.skipParamA === 1) {
            this.clickPathO()
          }
          if (val.params.skipParamB === 2) {
            this.clickPathP()
          }
          if (val.params.skipParamC === 3) {
            this.clickPathQ()
          }
          if (val.params.skipPathL === 7) {
            this.clickPathL()
          }
          if (val.params.skipPathM === 8) {
            this.clickPathM()
          }
        },
    // 深度观察监听
        deep: true
      },
      activeName (n, o) {
        this.$refs.child[this.index].init(n)
      },
      params () {
        this.$nextTick(() => {
          this.$refs.child[this.index].getDataList()
        })
      }
    },
    computed: {
      myHeader () {
        return {
          'token': Vue.cookie.get('token')
        }
      }
    },
    created () {
      this.getUserName()
      this.initOrgTree()
      this.initJobs()
      this.EditInitJobs()
      this.clickPackUp()
      this.indexPi = true
      this.indexPia = true
    },
    methods: {
      closeViewer () {
        this.showViewer = false
      },
      blurValidityEndTime () {
        if (this.params.validityEndTime !== '') {
          this.pickerOptionsValidityEndTimeA = {
            disabledDate: (time) => {
              return time.getTime() > this.params.validityEndTime
            }
          }
        } else {
          this.pickerOptionsValidityEndTimeA = {}
        }
      },
      onChange (val) {
        this.selectionIdDl = val
      },
      // 批量挂还
      clickHangAlso () {
        this.indexPi = false
        this.indexPia = false
        this.zuofeiliebiao = false
        this.params.certificateType = 2
        this.params.status = 3
        this.$refs.child[this.index].getDataListList()
        this.clickPackUp()
        this.$refs.child[this.index].halgTackHeight()
        this.selectionTrue = true
        this.hangAlsoDiog = true
      },
      // 批量还回
      clickHangShou () {
        this.indexPi = false
        this.indexPia = false
        this.zuofeiliebiao = false
        this.params.certificateType = ''
        this.params.status = ''
        this.params.warrantFlag = 1
        this.$refs.child[this.index].getDataListList()
        this.clickPackUp()
        this.$refs.child[this.index].halgTackHeight()
        this.selectionTrue = true
        this.hangshouhui = true
      },
      // 取消收回
      falseClickeA () {
        this.zuofeiliebiao = true
        this.indexPi = true
        this.indexPia = true
        this.params.certificateType = ''
        this.params.status = ''
        this.params.warrantFlag = ''
        this.selectionTrue = false
        this.hangshouhui = false
        this.clickPackUp()
        this.$refs.child[this.index].halgTackHeightguan()
        this.$refs.child[this.index].getDataListList()
      },

      falseClick () {
        this.zuofeiliebiao = true
        this.indexPi = true
        this.indexPia = true
        this.params.certificateType = ''
        this.params.status = ''
        this.selectionTrue = false
        this.hangAlsoDiog = false
        this.clickPackUp()
        this.$refs.child[this.index].halgTackHeightguan()
        this.$refs.child[this.index].getDataListList()
      },
      falseClickClick () {
        this.params.warrantFlag = ''
        this.falseClick()
        this.falseClickeA()
        this.queryAll()
      },
      trueClick () {
        this.$refs.child[this.index].traversalData()
      },
      trueClickeA () {
        this.$refs.child[this.index].traversalDataeA()
      },
      clickKive () {
        if (this.kiveList) {
          this.certificateListVisibleDetail = false
          this.certificateListVisible = true
          this.certificateinfoCrashVisible = false
          this.queryAll()
        }
      },
      clickPathA () {
        this.params.status = 0
        this.clickDataFormSubmit()
      },
      clickPathB () {
        this.params.status = 1
        this.clickDataFormSubmit()
      },
      clickPathC () {
        this.params.status = 21
        this.clickDataFormSubmit()
      },
      clickPathD () {
        this.params.status = 23
        this.clickDataFormSubmit()
      },
      clickPathE () {
        this.params.status = 22
        this.clickDataFormSubmit()
      },
      clickPathF () {
        this.params.status = 24
        this.clickDataFormSubmit()
      },
      clickPathO () {
        this.params.certificateType = 1
        this.clickDataFormSubmit()
      },
      clickPathP () {
        this.params.certificateType = 2
        this.clickDataFormSubmit()
      },
      clickPathQ () {
        this.params.certificateType = 3
        this.clickDataFormSubmit()
      },
      clickPathL () {
        console.log(223)
        this.params.status = 3
        this.clickDataFormSubmit()
      },
      clickPathM () {
        this.params.status = 2
        this.clickDataFormSubmit()
      },
      clicKunfold () {
        this.conceal = true
        if (this.userName !== 'admin') {
          this.concealName = true
        } else {
          this.concealName = false
          this.concealNameCol = true
          this.userCol = 2
        }
        this.unfold = false
        this.$refs.child[this.index].unfoldHeight()
      },
      clickPackUp () {
        this.conceal = false
        this.concealName = false
        this.concealNameCol = false
        this.unfold = true
        this.$refs.child[this.index].tackHeight()
      },
    // 获取钉钉扫码相关参数
    //  codeLogin () {
    //     this.appid = 'dingoavuscfukdnndjefka'
    //     this.redirect_uri = 'http://192.168.8.185/certificate-certificateinfolist'
    //     var obj = DDLogin({
    //       id: 'login_container',
    //       // goto这里需要对url整体做一个urlencode编码
    //       goto: encodeURIComponent('https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=' +this.appid+ '&response_type=code&scope=snsapi_login&state=STATE&redirect_uri='+ this.redirect_uri +''),
    //       style: 'border:none;background-color:#FFFFFF;',
    //       width: '365',
    //       height: '300'
    //     })
    //     var hanndleMessage = function (event) {
    //       let origin = event.origin
    //       // 判断是否来自ddLogin扫码事件
    //       if (origin === 'https://login.dingtalk.com') {
    //         let loginTmpCode = event.data
    //         // 这里url不用进行urlencode编码
    //          let url = 'https://oapi.dingtalk.com/connect/oauth2/sns_authorize?appid=' + this.appid + '&response_type=code&scope=snsapi_login&state=STATE&redirect_uri=' + this.redirect_uri + '&loginTmpCode=' + loginTmpCode
    //         window.location.href = url
    //       }
    //     }
    //     if (typeof window.addEventListener !== 'undefined') {
    //       window.addEventListener('message', hanndleMessage, false)
    //     } else if (typeof window.attachEvent !== 'undefined') {
    //       window.attachEvent('onmessage', hanndleMessage)
    //     }
    // },
      handleClose (done) {
        this.$confirm('确认关闭？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          showClose: false,
          center: true
        }).then(_ => {
          done()
        })
          .catch(_ => {})
      },
      handleDelete (index, row) {
        if (this.dxList[index]) {
          this.dxList.splice(index, 1)
        }
      },
      clickCertificateListVisible (row) {
        this.visId = row
        this.certificateListVisible = false
        this.certificateListVisibleDetail = true
      },
      handleAdd () {
        this.dxList.unshift({
          academic: '',
          borrowCandidatesSources: '',
          borrowContact: '',
          borrowContactMobile: '',
          borrowEndTime: '',
          borrowOrgName: '',
          borrowTime: '',
          certificateNo: '',
          certificateType: '',
          confType: '',
          idCard: '',
          remark: '',
          name: '',
          mobile: ''
        })
      },
      // 清空
      restForm () {
        this.params = {
          certificateType: '',
          name: '',
          status: ''
        }
        // this.$refs.queryModel[this.index].dataFormSubmit()

        // this.getDataListList()
        //  = {
        //   certificateType: '',
        //   name: '',
        //   status: ""
        // }
        // this.params = {}
      },
      routerBack () {
        this.certificateListVisible = true
        this.certificateListVisibleDetail = false
        this.clickPackUp()
      },
      // 搜索
      clickDataFormSubmit () {
      // this.$dateFormat(this.params.validityEndTime)
      // this.$dateFormat(this.params.validityEndTime)
        this.$refs.child[this.index].getDataListList()
      },
      openDetails (row, event, column) {
        this.currentRow = row
      },
      currentChange (currentRow, oldCurrentRow) {
        /* if(oldCurrentRow){
          this.confInfos = []
          this.professions = []
        }
        this.currentRow = currentRow; */
      },
      // sys/user/info
      getUserName () {
        this.$http({
          url: this.$http.adornUrl('/sys/user/info'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.userName = data.user.name
          }
        })
      },
      initOrgTree () {
        this.$http({
          url: this.$http.adornUrl('/tenant/tenantDeptInfo/tree'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.treeData = [data.deptInfo]
          } else {
            this.treeData = []
          }
        })
      },
      // ceshi
      ceshianniu () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/dingTalkLogin/'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          console.log(data)
        })
        // axios.get("https://oapi.dingtalk.com/connect/qrconnect")
      },
      // jobChange () {
      //   this.confInfos = []
      //   this.professions = []
      //   this.currentRow.idType = ''
      //   this.currentRow.profession = ''
      //   this.$nextTick(() => {
      //     this.$http({
      //       url: this.$http.adornUrl('/certificate/certificateInfo/getJobsConf'),
      //       method: 'get',
      //       params: this.$http.adornParams({
      //         'type': this.currentRow.confType
      //       })
      //     }).then(({data}) => {
      //       if (data && data.length > 0) {
      //         this.confInfos = data
      //       }
      //     })
      //   })
      // },
      // initJobs() {
      //   this.$http({
      //     url: this.$http.adornUrl('/certificate/certificateInfo/getJobs'),
      //     method: 'get',
      //     params: {}
      //   }).then(({data}) => {
      //     if (data && data.length > 0) {
      //       this.jobs = data
      //     }
      //   })
      // },
      jobChange (value, item) {
        this.confInfos = []
        this.professions = []
        this.params.profession = ''
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getJobsConf'),
          method: 'get',
          params: this.$http.adornParams({
            'type': value
          })
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.confInfos = data
          }
        })
      },
      // confChange () {
      //   this.professions = []
      //   this.currentRow.profession = ''
      //   this.$nextTick(() => {
      //     this.$http({
      //       url: this.$http.adornUrl('/certificate/certificateInfo/getJobsConf'),
      //       method: 'get',
      //       params: this.$http.adornParams({
      //         'type': this.currentRow.idType
      //       })
      //     }).then(({data}) => {
      //       if (data && data.length > 0) {
      //         this.professions = data
      //       }
      //     })
      //   })
      // },
      confChange (value, item) {
        this.professions = []
        this.params.profession = ''
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getJobsConf'),
          method: 'get',
          params: this.$http.adornParams({
            'type': value
          })
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.professions = data
          }
        })
      },
      // 测试 弹跳到新的 页面
      clickPone () {
        let details = this.$router.resolve({
          path: '/post-pone',
          query: {
            activeName: 'post-pone'
          }
        })
        window.open(details.href, '_blank', '')
      },
      // 点击看一下 没有证书的
      // noCertificate () {
      //   this.queryAll()
      // // this.$refs['child'].getNopicCert()
      // // this.$nextTick(() => {
      //   // console.log(this.$refs.child[this.index].isPics)
      //   this.$refs.child[this.index].isPics = false
      //   // pageIndex: 1,
      //   // pageSize: 10,
      //   // totalPage: 0,
      //   this.$refs.child[this.index].pageIndex = 1
      //   this.$refs.child[this.index].pageSize = 10
      //   this.$refs.child[this.index].totalPage = 0
      //   this.$refs.child[this.index].getNopicCert()
      // // })
      // },
      exportXls () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/export'),
          method: 'get',
          responseType: 'blob', // 防止返回乱码
          params: this.$http.adornParams(merge(this.params, {
            'status': this.flag ? 'crash' : this.params.status
          })),
          showLoading: true
        }).then(({data}) => {
          if (data) {
            const link = document.createElement('a')
            let blob = new Blob([data], {type: 'application/vnd.ms-excel'})
            link.style.display = 'none'
            link.href = URL.createObjectURL(blob)
            let fileName = '证书信息统计.xls'
            link.setAttribute('download', fileName)
            link.download = fileName // 下载的文件名
            document.body.appendChild(link)
            link.click()
            document.body.removeChild(link)
          }
        })
      },
      // 文件超出个数限制时的钩子
      exceedFile (files, fileList) {
        this.$message.warning(`只能选择 ${this.limitNum} 个文件，当前共选择了 ${files.length + fileList.length} 个`)
      },
      // 文件状态改变时的钩子
      fileChange (file, fileList) {
        this.fileList.push(file.raw)
      },
      // 上传文件之前的钩子, 参数为上传的文件,若返回 false 或者返回 Promise 且被 reject，则停止上传
      beforeUploadFile (file) {
        if (this.fileList.length >= this.limitNum) {
          this.$message.warning('只能上传一个文件')
          return false
        }
        let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
        let size = file.size / 1024 / 1024
        if (extension !== 'xlsx') {
          this.$message.warning('只能上传后缀是.xlsx的文件')
        }
        if (size > 10) {
          this.$message.warning('文件大小不得超过10M')
        }
      },
      handleSuccess (res, file, fileList) {
        this.$message.success('文件上传成功')
      },
      handleError (err, file, fileList) {
        this.$message.error('文件上传失败')
      },
      uploadUrl () {
        return ''
      },
      uploadFile () {
        if (this.fileList.length === 0) {
          this.$message.warning('请上传文件')
        } else {
          let form = new FormData()
          form.append('file', this.fileList[0])
          this.$http({
            url: this.$http.adornUrl('/certificate/certificateInfo/import'),
            method: 'post',
            headers: {
              'Content-type': 'multipart/form-data', 'token': Vue.cookie.get('token')
            },
            data: form,
            showLoading: true
          }).then(({data}) => {
            if (data && data.code === 0) {
              if (data.dxList && data.dxList.length > 0) {
                this.dialogConformVisible = true
                this.dxList = data.dxList
              } else {
                this.$message.error('批量上传无内容')
              }
            } else {
              this.$message.error(data.msg)
            }
          })
        }
      },
      dataFormSubmit () {
        this.$confirm('红色标识部分需填写，确定填写完整了吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          confirmButtonClass: 'el-button--danger',
          showClose: false,
          center: true
        }).then(() => {
          this.$http({
            url: this.$http.adornUrl('/certificate/certificateInfo/batchImport'),
            method: 'post',
            data: this.$http.adornData({'certificateInfos': this.dxList})
          }).then(({data}) => {
            if (data && data.code === 0) {
              this.dxList = []
              this.dialogConformVisible = false
              this.fileList = []
              this.dialogVisible = false
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                  this.$nextTick(() => {
                    this.$refs.child[this.index].getDataList()
                  })
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },
      // queryHandle () {
      //   this.$refs.child[this.index].pageIndex = 1
      //   this.$refs.child[this.index].pageSize = 10
      //   this.$refs.child[this.index].totalPage = 0
      //   this.$refs.child[this.index].isPics = true
      //   this.queryModelVisible = true
      //   this.$nextTick(() => {
      //     this.$refs.queryModel.init()
      //   })
      // },
      // 全部
      queryAll () {
      // this.pickerOptionsValidityEndTimeA = {}
      // this.$refs.child[this.index].pageIndex = 1
      // this.$refs.child[this.index].pageSize = 20
      // this.$refs.child[this.index].totalPage = 0
      // this.$refs.child[this.index].isPics = true
        this.params = {
          name: '',
          certificateType: '',
          status: '',
          idCard: '',
          mobile: '',
          academic: '',
          idType: '',
          pidTypes: '',
          profession: '',
          certificateNo: '',
          keepDeptId: '',
          registerType: '',
          projectName: ''
        }
          // this.blurValidityEndTime()
          // console.log();
        this.$refs.child[this.index].init(this.activeName)
/*       this.indexPi = true
      this.indexPia = true */
      },
      certificateinfoCrashHandler () {
        this.certificateListVisible = false
        this.certificateinfoCrashVisible = true
        this.$nextTick(() => {
          console.log(1)
          this.$refs.certificateinfoCrash.init()
          console.log(2)
        })
      },
      clickAppear () {
        this.certificateinfoCrashVisible = false
        this.certificateListVisible = true
        this.$refs.child[this.index].getDataListList()
      },
      handleClick (tab, event) {
        // this.clickPackUp()
        this.activeName = tab.name
        this.index = tab.index
        if (this.conceal) {
          this.clicKunfold()
        } else {
          this.clickPackUp()
        }
      },
      setParams (params) {
        this.params = params
      },
      // 证书头部点击切换的数据---
      initJobs () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getJobs'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.editableTabs = data
            this.editableTabs[0].code = 'all'
            setTimeout(() => {
              this.activeName = 'all'
            })
          }
        })
      },
      EditInitJobs () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getJobs'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.editableTabss = data
            this.editableTabss[0].code = ''
            console.log(this.editableTabss)
          }
        })
      },
      // 状态  借出  空闲---
      getRingCollect () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getRingCollect'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.chartData.rows = data
            // console.log(data)
          }
        })
      },
      getCertDetailCollect () {
        this.$http({
          url: this.$http.adornUrl('/certificate/certificateInfo/getCertDetailCollect'),
          method: 'get',
          params: {}
        }).then(({data}) => {
          if (data && data.length > 0) {
            this.waterfallData.rows = data
            // console.log(data);
          }
        })
      },
      templateDownload () {
        window.location.href = window.SITE_CONFIG.remoteUrl + 'others/certi-Template.xlsx'
      },
      refreshTable () {
        console.log(111)
      }
    }
  }
</script>

<style lang="scss" scoped>
.mod-configs{
  padding-left: 15px !important;
  padding-top: 15px !important;
  padding-right: 15px !important;
  padding-bottom: 15px !important;
  background-color: #F5F7FA !important;
  // margin-top: 48px;
}
.col-essss{
}
/deep/.div-hangAlso{
  width: 100%;
  height: 52px;
  position:absolute;
  bottom:0;
  box-shadow: 0px -3px 10px rgba(0, 0, 0, 0.16);
  // left: 200px;
  background-color: #fff;
  .div-hangS{
    height: 52px;
    width: 50%;
    float: left;
    display: flex;
    align-items: center;
    span{
    font-size: 14px;
    }
    .yixuanze{
      margin-left: 15px;
      font-size: 14px;
    }
    .shuju{
      margin-left: 10px;
      margin-right: 10px;
      font-size: 14px;
      color: #6E92E9;
    }
    .xiang{
      margin: 10px;
    }
  }
  .div-hangE{
    height: 52px;
    width: 50%;
    float: left;
    line-height: 52px;
    padding-right: 30px;
    padding-top: 12px;
  }
}
.div-s{
  width: 100%;
  background-color: #FFFFFF;
}
.div-inquire{
  width: 100%;
  height: 45px !important;
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  // display: flex;
  // align-items: center;
}
.div-button{
  // width: 30%;
  // float: right;
  margin-top: 15px;
  display: flex;
}
.in-t{
  width: 50%;
  float: left;
  height: 45px;
  display: flex;
  align-items: center;
  // margin-top: 15px;
  h3{
    float: left;
    font-size: 16px;
    color: #000000;
    margin: 0px !important;
    padding: 0px !important;
  }
}
.in-ts{
  width: 5px;
  height: 18px;
  float: left;
  margin-right: 8px;
  background: #6E92E9;
}
.div-e{
  width: 100%;
  background-color: #FFFFFF;
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 15px;
  margin-top: 15px;
}
.zhankai{
  margin-left: 7px;
}
/deep/.div-buttonItemb{
  float: right;
  font-size: 14px;
  i{
    font-size: 14px;
  }
}
/deep/.div-buttonItemc{
  float: right;
  margin-right: 8px;
  margin-left: 0px !important;
  font-size: 14px;
  i{
    font-size: 14px;
  }
}
/deep/.div-buttonItema{
  float: right;
  margin-right: 8px;
  font-size: 14px;
  i{
    font-size: 14px;
  }
}
.row-s{
  /deep/.el-col{
    display: flex;
    // justify-content: center;
    align-items: center;
    padding-left: 15px;
    padding-right: 15px;
  }
}
/deep/.col-right{
.el-form-item{
margin-left: auto!important;
}
}
/deep/.el-col{
    .fazheng{
    .el-form-item__content{
    .el-input--suffix{
    .el-input__inner{
      padding-right: 0px!important;
      padding-left: 30px!important;
       }
     }
   }
 }
}
/deep/.col-center{
  display: flex;
  align-items: center;
  justify-content: center;
}
.itemButton{
  width: 100%;
  margin-top: 10px !important;
}
/deep/.buttonItem{
  font-size: 14px !important;
  i{
    font-size: 14px;
  }
  }
  .el-card__body {
    padding: 10px 10px 10px 0 !important;
  }
  .wuzhengshu{
    margin-bottom: 12px;
  }
  /deep/.el-icon-refresh-right{
    font-size: 16px !important;
  }
  .el-tabs__nav-wrap::after{
    content:none
  }
  // .queryFormed{
  //  margin-top: 8px;
  // }
/deep/.tabs-s .el-tabs__active-bar{
  height: 2px !important;
}
/deep/.tabs-s{
  .el-tabs__header{
    .el-tabs__nav-wrap{
      margin-bottom: 0px !important;
     .el-tabs__nav-scroll{
      .el-tabs__nav{
        .el-tabs__item
        {
          border-right: none !important;
          border-left: none !important;
          background-color: #ffffff !important;
          // padding-left: 0px !important;
        }
      }
     }
    }
  }
}
/deep/.tabs-s{
.el-tabs__header{
  border-bottom: 1px solid #EBEEF5;
  margin:0px 0px 8px 0px !important;
.el-tabs__nav-wrap.is-scrollable{
 padding:0px !important;
}
  }
  }
  .queryFormed .el-form-item{
    margin-top: 8px;
    margin-bottom: 8px;
  }
  /deep/.queryFormed .el-form-item{
    .el-select .el-input__inner{
    height: 36px!important;
    padding-right: 15px!important;
    padding-left: 15px!important;
    }
    .el-input--suffix .el-input__inner{
    padding-right: 15px!important;
    padding-left: 15px!important;
    }
  }
  .el-button--danger {
    color: #f56c6c;
    background-color: #fff;
    border-color: #f56c6c;
  }
  .el-button--warning {
    color: #fc8e2d;
    background-color: #fff;
    border-color: #fc8e2d;
  }
  .el-table-add-row {
    margin-top: 10px;
    width: 100%;
    height: 34px;
    color: #1cca56;
    border: 1px dashed #1cca56;
    border-radius: 3px;
    cursor: pointer;
    justify-content: center;
    display: flex;
    line-height: 34px;
  }
    .edit-cell {
      min-height: 35px;
      cursor: pointer;
    }
    .danger-edit-cell{
      border: 1px dashed #e70927;
    }
    .el-alert--warning{
      margin-bottom: 10px;
    }
    // .iconexcel{
    //   color: #07ab6e;
    //   background-color: #fff;
    //   border-color: #07ab6e;
    // }
</style>
